<!DOCTYPE html>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<html>
    <head>
        <title>JS - 1.8</title>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width">
        <script>
        function extraireCaracteres () {
            var valeurChampTexte = document.formulaire.champTexte.value;
            var valeurDebutCaractere = document.formulaire.champDebutCaractere.value;
            var valeurFinCaractere = document.formulaire.champFinCaractere.value;
            var elementResultat = document.formulaire.champResultat;
            
            var valeurResultat = valeurChampTexte.substring(valeurDebutCaractere, valeurFinCaractere);
            
            elementResultat.value = valeurResultat;
        }    
        </script>
    </head>
    
    <body>
        <form name="formulaire">
            <input type="text" name="champTexte" value="">
            <input type="text" name="champDebutCaractere" value="">
            <input type="text" name="champFinCaractere" value="">
            <input type="button" value="Extraire" onclick="extraireCaracteres();">
            <input type="text" name="champResultat" value="">
        </form>
    </body>
</html>
